/*
 * @Author: 胡晓星
 * @Date: 2024-09-04 17:46:25
 * @LastEditors: error: git config user.name & please set dead value or install git
 * @LastEditTime: 2025-07-22 10:39:22
 * @FilePath: -serve\src\modules\player\dto.ts
 * @Description: 
 */
import {
  Allow,
  IsArray,
  IsBoolean,
  IsNotEmpty,
  IsOptional,
  IsString,
  Length,
} from 'class-validator';
/*************    球员列表    *************/
export class GetPlayersDto {
  @Allow()
  pageSize?: number;

  @Allow()
  pageNo?: number;

  @Allow()
  playerName?: string;

  @Allow()
  teamId?: number;
}
export class CreatePlayerDto {
  @IsString()
  @IsNotEmpty({ message: '球员名称不能为空' })
  @Length(2, 20, {
    message: `队伍名称长度必须大于$constraint1到$constraint2之间，当前传递的值是$value`,
  })
  player_name: string;

  @IsOptional()
//   @IsNotEmpty({ message: '球员球衣号码不能为空' })
  player_number: string;

  @IsOptional()
  @IsNotEmpty({ message: '球员身高不能为空' })
  height?: string;

  @IsOptional()
  @IsNotEmpty({ message: '球员体重不能为空' })
  weight?: string;

  @IsOptional()
  position?: string;

  @IsOptional()
  team_id?: number;

  @IsOptional()
  session?: number;
}
export class UpdatePlayerDto {
  @IsString()
  @IsNotEmpty({ message: '球员名字不能为空' })
  @Length(2, 20, {
    message: `球员名字长度必须大于$constraint1到$constraint2之间，当前传递的值是$value`,
  })
  player_name: string;

  @IsOptional()
//   @IsNotEmpty({ message: '球员球衣号码不能为空' })
  player_number: string;

  @IsOptional()
  @IsNotEmpty({ message: '球员身高不能为空' })
  height?: string;

  @IsOptional()
  @IsNotEmpty({ message: '球员体重不能为空' })
  weight?: string;

  @IsOptional()
  position?: string;

  @IsOptional()
  team_id?: number;

  @IsOptional()
  session?: number;
}


 /*************    球队列表    *************/
export class GetTeamsDto {
  @Allow()
  pageSize?: number;

  @Allow()
  pageNo?: number;

  @Allow()
  team_name?: string;

  @Allow()
  session?: number;
}
export class CreateTeamDto {
  @IsString()
  @IsNotEmpty({ message: '队伍名称不能为空' })
  @Length(2, 20, {
    message: `队伍名称长度必须大于$constraint1到$constraint2之间，当前传递的值是$value`,
  })
  team_name: string;

  @IsOptional()
  group?: string;

  @IsOptional()
  session?: number;
}
export class UpdateTeamDto {
  @IsString()
  @IsNotEmpty({ message: '队伍名称不能为空' })
  @Length(2, 20, {
    message: `队伍名称长度必须大于$constraint1到$constraint2之间，当前传递的值是$value`,
  })
  team_name: string;

  @IsOptional()
  group?: string;

  @IsOptional()
  session?: number;
}